package wetogether.travelinfo.service;

import java.sql.SQLException;
import java.util.List;

import wetogether.travelinfo.dao.InputTravelInfoDAO;
import wetogether.travelinfo.dao.OutputTravelInfoDAO;
import wetogether.travelinfo.vo.TravelCommentVO;
import wetogether.travelinfo.vo.TravelFrVO;
import wetogether.travelinfo.vo.TravelImageVO;
import wetogether.travelinfo.vo.TravelInfoVO;
import wetogether.travelinfo.vo.TravelVacancyVO;
import wetogether.travelinfo.vo.TravelZoneVO;

public class InputTravelInfoServiceImpl implements InputTravelInfoService {
	private InputTravelInfoDAO inputTravelInfoDAO;
	private OutputTravelInfoDAO outputTravelInfoDAO;
	public void setInputTravelInfoDAO(InputTravelInfoDAO inputTravelInfoDAO){
		this.inputTravelInfoDAO=inputTravelInfoDAO;
		System.out.println("InputTravelInfoDAO injection....");
	}
	public void setOutputTravelInfoDAO(OutputTravelInfoDAO outputTravelInfoDAO){
		this.outputTravelInfoDAO=outputTravelInfoDAO;
		System.out.println("OutputTravelInfoDAO injection....");
	}
	/**
	 * 0. 지역 정보 입력
	 */
	public void insertTravelZone(TravelZoneVO zoneVO) throws SQLException {
		inputTravelInfoDAO.insertTravelZone(zoneVO);
	}
	/**
	 * 1. 여행지 정보 입력
	 */
	@Override
	public void insertTravelInfo(TravelInfoVO tVO) throws SQLException {
		inputTravelInfoDAO.insertTravelInfo(tVO);
	}
	/**
	 * 2. 여행지의 이미지들 입력
	 */
	@Override
	public void insertPlaceImage(TravelImageVO imgVO) throws SQLException {
		inputTravelInfoDAO.insertPlaceImage(imgVO);
	}
	/**
	 * 3. 숙박 정보 입력
	 */
	@Override
	public void insertPlaceVacancy(TravelVacancyVO vacancyVO)
			throws SQLException {
		inputTravelInfoDAO.insertPlaceVacancy(vacancyVO);
	}
	/**
	 * 4. 맛집 정보 입력
	 */
	@Override
	public void insertPlaceFr(TravelFrVO frVO) throws SQLException {
		inputTravelInfoDAO.insertPlaceFr(frVO);
	}
	/**
	 * 5. 공지사항 입력
	 */
	@Override
	public void insertPlaceNotice(TravelInfoVO tVO) throws SQLException {
		inputTravelInfoDAO.insertPlaceNotice(tVO);
	}
	/**
	 * 6. 댓글 입력
	 */
	@Override
	public void insertPlaceComment(TravelCommentVO commentVO)
			throws SQLException {
		inputTravelInfoDAO.insertPlaceComment(commentVO);
	}
	/**
	 * 7. 여행정보에 추천점수 입력
	 */
	@Override
	public void insertTravelInfoRecommend(TravelCommentVO commentVO)
			throws SQLException {
		inputTravelInfoDAO.insertTravelInfoRecommend(commentVO);	
	}
	////////////////////////////////////////
	// 입력 전 값 확인
	////////////////////////////////////////
	/**
	 * 존재하는 지역 리스트값을 받아온다
	 */
	@Override
	public List<TravelZoneVO> findTravelZoneList() throws SQLException {
		return outputTravelInfoDAO.findTravelZoneList();
	}
	/**
	 * 해당 지역에 존재하는 여행지 리스트값을 받아온다.
	 */
	@Override
	public List<String> findTravelPlaceList(int locationid)
			throws SQLException {
		return outputTravelInfoDAO.findTravelPlaceList(locationid);
	}
	/**
	 * 숙박 입력 전, 이미 있는지 확인
	 */
	@Override
	public List<String> isPlaceVacancy(String place) throws SQLException {
		return outputTravelInfoDAO.isPlaceVacancy(place);
	}
	/**
	 * 맛집 입력 전, 이미 있는지 확인
	 */
	@Override
	public List<String> isPlaceFr(String place) throws SQLException {
		return outputTravelInfoDAO.isPlaceFr(place);
	}
	/**
	 * 공지 입력 전, 이미 있는지 확인
	 */
	@Override
	public String isPlaceNotice(String place) throws SQLException {
		return outputTravelInfoDAO.isPlaceNotice(place);
	}
	public List<String> getPlaceImageList(String place) throws SQLException{
		return outputTravelInfoDAO.getPlaceImageList(place);
	}
}
